using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.Ai;

/// <summary>
/// 系统提示词实体类
/// </summary>
public class SysPrompt : BasePoco
{
    [Required(ErrorMessage = "请输入提示词名称")]
    [Display(Name = "名称", Description = "提示词名称", GroupName = "基本信息")]
    [StringLength(256)]
    public string Name { get; set; }

    [Required(ErrorMessage = "请输入提示词编码")]
    [Display(Name = "编码", Description = "提示词唯一编码", GroupName = "基本信息")]
    [StringLength(128)]
    public string Code { get; set; }

    [Display(Name = "描述", Description = "提示词的详细描述或说明", GroupName = "基本信息")]
    [StringLength(1000)]
    public string Description { get; set; }

    [Display(Name = "分组ID", Description = "关联的提示词分组ID", GroupName = "分组信息")]
    public Guid? GroupId { get; set; }

    [Display(Name = "提示词分组", Description = "关联的提示词分组", GroupName = "分组信息")]
    public SysPromptGroup Group { get; set; }

    [Required(ErrorMessage = "请输入系统提示词")]
    [Display(Name = "系统提示词", Description = "系统角色提示词内容", GroupName = "提示词内容")]
    [JsonConverter(typeof(JsonStringConverter))]
    public string SystemPrompt { get; set; }

    [Required(ErrorMessage = "请输入用户提示词")]
    [Display(Name = "用户提示词", Description = "用户提示词模板", GroupName = "提示词内容")]
    [JsonConverter(typeof(JsonStringConverter))]
    public string UserPrompt { get; set; }

    [Display(Name = "版本号", Description = "提示词版本号", GroupName = "版本管理")]
    public int Version { get; set; } = 1;

    [Display(Name = "排序", Description = "显示排序，数值越小越靠前", GroupName = "显示设置")]
    public int? SortOrder { get; set; }

    [Display(Name = "是否启用", Description = "是否启用此提示词", GroupName = "状态信息")]
    public bool IsEnabled { get; set; } = true;
    
    [Display(Name = "备注", Description = "备注信息", GroupName = "其他信息")]
    [StringLength(500)]
    public string Remark { get; set; }
}

/// <summary>
/// 系统提示词分组实体类
/// </summary>
public class SysPromptGroup : BasePoco
{
    [Required(ErrorMessage = "请输入分组名称")]
    [Display(Name = "分组名称", Description = "提示词分组名称", GroupName = "基本信息")]
    [StringLength(256)]
    public string Name { get; set; }

    [Required(ErrorMessage = "请输入分组编码")]
    [Display(Name = "分组编码", Description = "提示词分组唯一编码", GroupName = "基本信息")]
    [StringLength(128)]
    public string Code { get; set; }

    [Display(Name = "分组描述", Description = "分组的详细描述", GroupName = "基本信息")]
    [StringLength(512)]
    public string Description { get; set; }

    [Display(Name = "排序", Description = "分组显示排序，数值越小越靠前", GroupName = "显示设置")]
    public int? SortOrder { get; set; }

    [Display(Name = "是否启用", Description = "是否启用此分组", GroupName = "状态设置")]
    public bool IsEnabled { get; set; } = true;

    [Display(Name = "备注", Description = "备注信息", GroupName = "其他信息")]
    [StringLength(500)]
    public string Remark { get; set; }
}